package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2023-03-03
 * Time: 11:05
 */

@Mapper
public interface ArticleInfoMapper {

    //添加数据,返回影响行数
    public int add(@Param("articleInfo") ArticleInfo articleInfo);

    //添加数据,返回自增主键id
    public int addGetId(@Param("articleInfo") ArticleInfo articleInfo);

    //删除数据
    public int delById(@Param("id") Integer id);

    //修改数据
    public int updateTitle(@Param("id")Integer id,@Param("title")String title);

    //关键字传参
    public List<ArticleInfo> getOrder(@Param("order")String order);

    //联合查询
    public List<ArticleInfo> getAll();
}
